<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="message-Type" content="text/html; charset=UTF-8">
<title>Message</title>

<link type="text/css" href="/TopGay/css/jquery-ui.min.css" rel="stylesheet">
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="/TopGay/script/jquery-ui.min.js"></script>
<link media="screen" rel="stylesheet" href="/${initParam.context_root }/css/bootstrap.min.css">
<link href="/${initParam.context_root }/css/starter-template3.css" rel="stylesheet">

<script type="text/javascript">
	if ('${requestScope.check_num }') {

		alert("전송이 완료되었습니다.");
	}

	$(document).ready(function() {

		$("#buttonMessage").on("click", function() {
			$("#messagePopup").dialog({
				width : 394,
				height : 485,
				buttons : {
					"닫기" : function() {
						//this : dialog 로 뜬 블럭(div)
						$(this).dialog("close");
					},
					"전송" : function() {
						$("form").submit();
					}
				}
			});
		});

	});
</script>


</head>
<body>

	<div class="container">
		<div class="starter-template">
			<div class="panel panel-primary">
				<div class="panel-heading">제목 : ${requestScope.message.title }</div>
				<div class="panel-body">
					보낸 사람 : ${requestScope.message.fromId }
					<p>
						보낸 시간 : ${requestScope.message.days} <br> <br>

						----------------------------------- <br><br>
						${requestScope.message.content }
				</div>
			</div>
<div align="right">
			<a
				href="/${initParam.context_root }/message/deleteMessage.do?num=${requestScope.message.num}&page=${param.page}&id=${requestScope.message.toId}"><button class="btn btn-danger">삭제</button></a>
			<button id="buttonMessage" class="btn btn-success">답장</button>

			<br>
</div>

			<div id="messagePopup" class="dialog" title="쪽지 보내기" style="display: none">
				<form action="/${initParam.context_root }/message/messageSend1.do">
					제목 <input type="text" name="title" placeholder="제목을 입력하세요" size="42" /><br> <br>
					<!-- 창 크기와 버튼을 위치를 조정하자  -->
					내용
					<textarea rows="10" cols="40" name="content" placeholder="내용을 입력하세요"></textarea>
					<input type="hidden" name="toId" value="${requestScope.message.fromId}" /> <input
						type="hidden" name="fromId" value="${sessionScope.login_info.id }" /> <input type="hidden"
						name="days" value="${requestScope.message.days}" /> <input type="hidden" name="num"
						value="${requestScope.message.num }" />
				</form>
			</div>
		</div>
	</div>
</body>
</html>